
#include "flash.h"
#include "string.h"

u32 Verity_buf[32];



/*********************************************************************
 * @fn      CH32_IAP_Program
 *
 * @brief   adr - the date address
 *          buf - the date buffer
 *
 * @return  none
 */
void CH32_IAP_Program(u32 adr, u32* buf) {

    FLASH_ProgramPage_Fast(adr, buf);
}

void FLASH_Read(uint32_t addr, void *buf, uint32_t len) {
    uint8_t *src = (uint8_t*)addr;
    uint8_t *dst = (uint8_t*)buf;
    while (len--) {
        *dst++ = *src++;
    }
}

